package myapp.events 
{
	import com.bumpslide.command.CommandEvent;

	import flash.events.Event;

	/**
	 * App-specific command event
	 * 
	 * This is where we put the named constants that map to commands
	 * unless we need more command-specific events with custom properties.
	 * 
	 * @author David Knape
	 */
	public class AppEvent extends CommandEvent 
	{

		public static const STARTUP:String = "cmdStartup";
		public static const SELECT_IMAGE:String = "cmdSelectImage";

		
		public function AppEvent(type:String, data:Object = null, resultHandler:Function = null, faultHandler:Function = null)
		{
			super(type, data, resultHandler, faultHandler);
		}

		
		override public function clone():Event
		{
			return new AppEvent(type, data, resultHandler, faultHandler);
		}
		
		/**
		 * static shortcut
		 */
        static public function send( type:String, data:Object=null, resultHandler:Function=null, faultHandler:Function=null) : void {
        	var cmd:AppEvent = new AppEvent( type, data, resultHandler, faultHandler );
        	cmd.dispatch();
        } 
	}
}
